package com.tcp2.frame.plat;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author: <张锦煌>
 * Time: 2015-10-27 15:04
 * Copyright (C) 2015 Xiamen Yaxon Networks CO.,LTD.
 */
public class Frame00E9 {

    public JTextField simField = new JTextField("18259496000",20);   //SIM卡
    public JTextField noField = new JTextField("007",20);   //司机工号
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date time=new Date();
    public JTextField timeField=new JTextField(format.format(time),20); //评价时间
    public JRadioButton resultGood=new JRadioButton("好",true);
    public JRadioButton resultBad=new JRadioButton("不好");

    //主容器
    JPanel jp;

    public Frame00E9(JPanel parent) {
        this.jp = parent;
    }

    /**
     * 初始化界面
     */
    public void init(){
        Box box1 = Box.createHorizontalBox();
        JLabel jlDesc = new JLabel("功能描述：透传乘客服务评价信息; 消息ID=0x0900, 命令字:0x00E9");
        box1.add(jlDesc);

        JPanel jp1 = new JPanel();
        TitledBorder t2 = new TitledBorder("服务评价信息");
        jp1.setBorder(t2);

        JLabel l1 = new JLabel("SIM卡:      ");
        Box box3 = Box.createHorizontalBox();
        box3.add(l1);box3.add(simField);

        JLabel l2 = new JLabel("司机工号:   ");
        Box box4 = Box.createHorizontalBox();
        box4.add(l2);box4.add(noField);

        JLabel l3 = new JLabel("评价时间:   ");
        Box box5 = Box.createHorizontalBox();
        box5.add(l3);box5.add(timeField);

        ButtonGroup bg=new ButtonGroup();
        bg.add(resultGood);
        bg.add(resultBad);
        JLabel l4 = new JLabel("评价结果:  ");
        Box box6 = Box.createHorizontalBox();
        box6.add(l4);box6.add(resultGood);
        box6.add(Box.createHorizontalStrut(20));box6.add(resultBad);
        box6.add(Box.createHorizontalStrut(40));
        Box box2 = Box.createVerticalBox();
        box2.add(Box.createVerticalStrut(10));
        box2.add(box3);
        box2.add(Box.createVerticalStrut(10));
        box2.add(box4);
        box2.add(Box.createVerticalStrut(10));
        box2.add(box5);
        box2.add(Box.createVerticalStrut(10));
        box2.add(box6);
        box2.add(Box.createVerticalStrut(10));

        jp1.add(box2);

        Box box = Box.createVerticalBox();
        box.add(Box.createVerticalStrut(20));
        box.add(box1);
        box.add(Box.createVerticalStrut(10));
        box.add(jp1);

        jp.add(box,"p6");
    }

}
